package com.changepic;

import com.changepic.downloadImageAsync.DownLoadImageAsyncActivity;
import com.changepic.gallery.NetworkGalleryActivity;
import com.changepic.randomText.RandomActivity;
import com.changepic.share.ShareActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {

	private Button picscroll,asyncdownimage,toShared,gallery,randomText;
	
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		setViews();
		setListeners();
	}
	
	
	public void setViews(){
		picscroll = (Button)findViewById(R.id.picscroll);
		asyncdownimage = (Button)findViewById(R.id.asyncdownloadimage);
		toShared = (Button)findViewById(R.id.toshared);
		gallery = (Button)findViewById(R.id.gallery);
		randomText = (Button)findViewById(R.id.randomText);
	}
	
	public void setListeners(){
		picscroll.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this,ChangePicActivity.class);
				startActivity(intent);
			}
		});
		asyncdownimage.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this,DownLoadImageAsyncActivity.class);
				startActivity(intent);
			}
		});
		toShared.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this,ShareActivity.class);
				startActivity(intent);
			}
		});
		gallery.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this,NetworkGalleryActivity.class);
				startActivity(intent);
			}
		});
		
		randomText.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent();
				intent.setClass(MainActivity.this,RandomActivity.class);
				startActivity(intent);
			}
		});
	}
}
